<?php
/**
 * All cache, no cheques.
 *
 * @author Paul Gibbs <paul@byotos.com>
 * @package Achievements for BuddyPress
 * @subpackage cache
 *
 * $Id$
 */

/**
 * Deletes highscore cache for all widgets.
 *
 * @since 2.0
 */
function dpa_delete_highscore_cache() {
	$sitewide_widget_options = get_option( 'widget_achievements-sitewide' );
	foreach ( $sitewide_widget_options as $widget ) {
		if ( empty( $widget ) )
			continue;

		wp_cache_delete( 'dpa_high_scorers_' . apply_filters( 'dpa_widget_limit', $widget->limit ), 'dpa' );
	}
}
?>